package exception;

public class ThrowDemo {
    public static void main(String[] args){
        Person A  = new Person();
        try {
            A.setAge(1000);
        } catch (IllegalAgeException e) {
            e.printStackTrace();
            //System.out.println(e.getMessage());
        }
        System.out.println("此人年龄是:"+A.getAge());
    }
}
